package experiment4;

import java.util.Scanner;

public class No_3 {
    public static void main(String []args)
    {
        System.out.println("请输入数组的行数和列数：");
        Scanner input=new Scanner(System.in);
        int row=input.nextInt();
        int column=input.nextInt();
        double[][] a=new double[row][column];

        System.out.println("请输入这个数组的元素：");
        for(int i=0;i<row;i++)
        {
            for(int j=0;j<column;j++)
            {
                a[i][j]=input.nextDouble();
            }
        }


        Location new_a=Location.locateLargest(a);
        System.out.println("最大的元素是"+new_a.maxValue+" ,坐标是("+new_a.row+","+new_a.column+")");
    }
}
class Location{
    public static int row;
    public static int column;
    public static double maxValue;



    public static Location locateLargest(double[][] a)
    {


        maxValue=a[0][0];
        row=0;
        column=0;
        for(int i=0;i<a.length;i++)
        {
            for(int j=0;j<a[0].length;j++)
            {
                maxValue=Math.max(maxValue,a[i][j]);
                row=i;
                column=j;
            }
        }
        return new Location();

    }

}
